//
//	structure copy in C
//
//	Test Notes:
//	It's possible to do simple structure copies directly in C.
//
//	compile with gcc test5.c -Wall -Werror -o test5.exe
//
#include <stdio.h>

typedef struct {
	double		amp;
	double		f_start;
	double		f_end;
	int			sr;
	int			time;
} PARAM_T;


void display_param(PARAM_T* p_in)
{
	printf("param display:\n");
	printf("  Attenuation: %f\n",		p_in->amp);
	printf("  Start freq: %f\n",		p_in->f_start);
	printf("  End freq: %f\n",			p_in->f_end);
	printf("  Sample Rate: %d\n",		p_in->sr);
	printf("  Time in seconds: %d\n\n",	p_in->time);
}


int main(void)
{
	PARAM_T t1 = { 1.0, 10.0, 1000.0, 44100, 7 };
	PARAM_T t2 = { 444.0, 4444.0, 44444.0, 11200, 42 };

	printf("t1 "), display_param(&t1);
	printf("t2 "), display_param(&t2);

	t2 = t1;

	printf("t1 "), display_param(&t1);
	printf("t2 "), display_param(&t2);

	return 0;
}

